package com.train.monitor;

public class Producer implements Runnable{
    private SyncContainer syncContainer;

    public Producer(SyncContainer syncContainer) {
        this.syncContainer = syncContainer;
    }

    @Override
    public void run() {
        // 生产者生产：暂且用24个大写英文字母替代商品名
        for (int i = 0; i < 24; i++) {
            try {
                syncContainer.push(new Goods(10+i,String.format("%c",(char)i+65)));
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
